import { Injectable } from '@angular/core';
import { StateMachineService } from "@farris/command-services";
import { FrameContext } from '@farris/devkit';
import { BefRepository, ResponseInfo } from '@farris/bef';
import { FormMessageService, FormNotifyService, CommandService, FormLoadingService, BeActionService } from '@farris/command-services';
import { EMPTY, of } from 'rxjs';
import { tap, map, switchMap } from 'rxjs/operators';


@Injectable()
export class GzxxxzFrmControllerService {
  // gzxxxz-ll3m-component
  private frameCode = "tr4d";
  private frameId = "gzxxxz-" + this.frameCode + "-component_gzxxxz_data-grid-component";
  constructor(
    private frameContext: FrameContext,
    private messageService: FormMessageService,
    private beActionService: BeActionService,
    public stateMachineService: StateMachineService,
    public formNotifyService: FormNotifyService,
    private commandService: CommandService,
    public loadingService: FormLoadingService
  ) {}

  /**
   * 确认点击事件
   * @remarks 
   * @returns 
   */
  confirm(): any {
     const checkeds = this.frameContext.appContext.componentManager.get([this.frameId, 'dataGrid']).checkeds;
     debugger
     this.frameContext.uiState.setPropertyValue('datas', "");
     let datas: Object[] = [];
     for (let item of checkeds) {
        datas.push(item);
     }
     this.frameContext.uiState.setPropertyValue('datas', datas);
  }
}
